from .chaos_mesh import ChaosMeshConnection, CHAOS_MESH
from datetime import datetime, timedelta
import pandas as pd


def export_chaos_mesh_data(start_time, end_time):
    cm_conn = ChaosMeshConnection(CHAOS_MESH)
    # end_time = datetime.now()
    # start_time = end_time - timedelta(days=12)
    # end_time = end_time - timedelta(days=6)

    data = cm_conn.create_ground_truth(start_time, end_time)
    pd.DataFrame(data).to_csv("/JumpStarter/data/ground_truth/ground_truth.csv", index=False)
